package com.atguigu.utils;

import javax.servlet.http.HttpServletRequest;

/**
 * Date:2020/9/12
 * Author:ybc
 * Description:
 */
public class WebUtils {

    public static String getPath(HttpServletRequest request){
        //获取当前请求的请求路径
        String requestURI = request.getRequestURI();
        //获取请求地址后所拼接的请求参数
        String queryString = request.getQueryString();
        if(queryString.contains("&pageNo")){
            queryString = queryString.substring(0,queryString.indexOf("&pageNo"));
        }
        return requestURI+"?"+queryString;
    }

}
